<script lang="ts">
	import { Any } from '$lib/api/proto/google/protobuf/any';
	import { TrueOrFalseQuestion } from '$lib/api/proto/resource_exam_type_api';

	interface Props {
		question: Any;
	}
	let props: Props = $props();

	let question = $state(Any.unpack(props.question, TrueOrFalseQuestion));

	$effect(() => {
		question = Any.unpack(props.question, TrueOrFalseQuestion);
	});
</script>

<div class="prose max-w-none p-2 w-full">
	<h3>问题:{question.question}</h3>
	<h4>参考答案:{question.rightAnswer ? 'zhengq' : '错误'}</h4>
</div>
